package biz.obake.team.touchprotector.f;

import android.os.Handler;
import android.view.MotionEvent;
import android.view.View;
import android.view.animation.AlphaAnimation;
import android.widget.TextView;
import biz.obake.team.touchprotector.R;
import biz.obake.team.touchprotector.f.l;
import d.e;
import d.h.b.c;

public final class h implements l {

    /* renamed from: b  reason: collision with root package name */
    private final Handler f1622b = new Handler();
    /* access modifiers changed from: private */

    /* renamed from: c  reason: collision with root package name */
    public final View f1623c;

    /* renamed from: d  reason: collision with root package name */
    private final k f1624d;

    static final class a implements Runnable {

        /* renamed from: b  reason: collision with root package name */
        final /* synthetic */ h f1625b;

        a(h hVar) {
            this.f1625b = hVar;
        }

        public final void run() {
            AlphaAnimation alphaAnimation = new AlphaAnimation(1.0f, 0.0f);
            alphaAnimation.setDuration(250);
            this.f1625b.f1623c.startAnimation(alphaAnimation);
            this.f1625b.f1623c.setVisibility(8);
        }
    }

    public h(k kVar) {
        c.c(kVar, "mPV");
        this.f1624d = kVar;
        View findViewById = this.f1624d.findViewById(R.id.noticesPanel);
        c.b(findViewById, "mPV.findViewById(R.id.noticesPanel)");
        this.f1623c = findViewById;
    }

    public void a() {
        this.f1622b.removeCallbacksAndMessages((Object) null);
        this.f1623c.setVisibility(8);
    }

    public boolean b(MotionEvent motionEvent) {
        c.c(motionEvent, "event");
        return l.a.a(this, motionEvent);
    }

    public void c() {
        l.a.d(this);
    }

    public void d() {
        this.f1623c.setVisibility(8);
        if (biz.obake.team.touchprotector.g.a.g("show_notices_message") && !this.f1624d.g() && biz.obake.team.touchprotector.notice.a.b().a() != 0) {
            View findViewById = this.f1623c.findViewById(R.id.noticeAlertText);
            if (findViewById != null) {
                ((TextView) findViewById).setText(R.string.pv_notices_alert);
                AlphaAnimation alphaAnimation = new AlphaAnimation(0.0f, 1.0f);
                alphaAnimation.setDuration(250);
                this.f1623c.startAnimation(alphaAnimation);
                this.f1623c.setVisibility(0);
                this.f1622b.postDelayed(new a(this), 3000);
                return;
            }
            throw new e("null cannot be cast to non-null type android.widget.TextView");
        }
    }
}
